const express = require('express')
const router = express.Router()

// 健康检查
router.get('/health', (req, res) => {
  res.json({
    code: 200,
    message: '服务运行正常',
    data: {
      status: 'OK',
      timestamp: new Date().toISOString(),
      version: '1.0.0',
      environment: process.env.NODE_ENV || 'development'
    },
    timestamp: Date.now()
  })
})

// API信息
router.get('/info', (req, res) => {
  res.json({
    code: 200,
    message: 'API信息',
    data: {
      name: '代账记账系统API',
      version: '1.0.0',
      description: '专业的代账公司管理系统后端接口',
      author: '开发团队',
      endpoints: {
        auth: '/api/auth/*',
        health: '/api/health',
        info: '/api/info'
      }
    },
    timestamp: Date.now()
  })
})

// 引入各模块路由
const authRoutes = require('./auth')

// 挂载路由
router.use('/auth', authRoutes)

// 未来的路由模块（暂时注释）
// router.use('/customers', customerRoutes)
// router.use('/payments', paymentRoutes)
// router.use('/collections', collectionRoutes)
// router.use('/accounting', accountingRoutes)
// router.use('/stats', statsRoutes)
// router.use('/admin', adminRoutes)
// router.use('/messages', messageRoutes)

module.exports = router 